package com.jtny.nytb.equipment.service;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.jtny.component.entity.PageData;
import com.jtny.component.exception.ServiceException;
import com.jtny.nytb.equipment.dto.model.ModelInfoDTO;
import com.jtny.nytb.equipment.enums.DataParamImportEnum;
import com.jtny.nytb.equipment.vo.excel.ExportExcelModelVO;
import com.jtny.nytb.equipment.vo.model.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * @author 智慧能源中心 - zx
 * @package com.jtny.nytb.energymonitor.equipment.service
 * @fileName EquipmentModelService.java
 * @createTime 2023年09月14日 14:31
 * @Copyright© 2023 jtny
 * 江投能源技术研究院 版权所有
 */
@Api(value = "设备模型管理Service接口", tags = "设备模型管理Service接口")
@ApiSort(202301)
@ResponseBody
public interface EquipmentModelService {
    /**
     * 查询分页设备模型参数信息
     *
     * @param equipmentModelQueryPageParamDTO
     * @return
     * @throws ServiceException
     */
    @ApiOperation("查询分页设备模型参数信息")
    @ApiImplicitParam(name = "equipmentModelQueryPageParamDTO", value = "设备模型参数信息查询对象DTO", required = true, paramType = "query", dataType = "EquipmentModelQueryPageParamDTO")
    @ApiOperationSupport(order = 4)
    @PostMapping("/queryPages")
    PageData<EquipmentModelParamTempVO> queryPages(@RequestBody EquipmentModelQueryPageParamTempVO equipmentModelQueryPageParamDTO) throws ServiceException;

    /**
     * 通过设备模型id查询设备模型信息
     *
     * @param id
     * @return
     * @throws ServiceException
     */
    @ApiOperation("通过设备模型id查询设备模型信息")
    @ApiImplicitParam(name = "主键id", value = "主键id", required = true, paramType = "path")
    @ApiOperationSupport(order = 2)
    @GetMapping("/getById/{id}")
    ModelTempVO getById(@PathVariable("id") Long id) throws ServiceException;


    /**
     * 查询分页设备模型信息
     *
     * @param equipmentModelPageQueryParamDTO
     * @return
     * @throws ServiceException
     */
    @ApiOperation("查询分页设备模型信息")
    @ApiOperationSupport(order = 1)
    @GetMapping("/queryPage")
    PageData<ModelTempVO> queryPage(@SpringQueryMap EquipmentModelPageQueryParamTempVO equipmentModelPageQueryParamDTO);

    /**
     * 保存设备模型参数信息
     */
    @ApiOperation("保存设备模型参数信息")
    @ApiImplicitParam(name = "equipmentModelParamDTO", value = "保存设备模型参数信息对象DTO", required = true, paramType = "query", dataType = "EquipmentModelParamDTO")
    @ApiOperationSupport(order = 5)
    @PostMapping("/savaParam")
    EquipmentModelParamTempVO savaParam(@RequestBody EquipmentModelParamTempVO equipmentModelParamDTO) throws ServiceException;


    /**
     * 修改设备模型信息
     *
     * @param modelDTO
     * @return
     * @throws ServiceException
     */
    @ApiOperation("修改设备模型信息")
    @ApiImplicitParam(name = "equipmentModelDTO", value = "修改设备模型信息对象DTO", required = true, paramType = "query", dataType = "EquipmentModelDTO")
    @ApiOperationSupport(order = 3)
    @PostMapping("/update")
    ModelTempVO update(@RequestBody ModelTempVO modelDTO) throws ServiceException;

    /**
     * 通过设备模型参数id查询单个设备模型参数信息
     *
     * @param id
     * @return
     * @throws ServiceException
     */
    @ApiOperation("通过设备模型参数id查询单个设备模型参数信息")
    @ApiImplicitParam(name = "主键id", value = "主键id", required = true, paramType = "path")
    @ApiOperationSupport(order = 6)
    @GetMapping("/getByIdParam/{id}")
    EquipmentModelParamTempVO getByIdParam(@PathVariable("id") Long id) throws ServiceException;

    /**
     * 修改设备模型参数信息
     *
     * @param equipmentModelParamDTO
     * @return
     * @throws ServiceException
     */
    @ApiOperation("修改设备模型参数信息")
    @ApiImplicitParam(name = "equipmentModelParamDTO", value = "修改设备模型信息对象DTO", required = true, paramType = "query", dataType = "EquipmentModelParamDTO")
    @ApiOperationSupport(order = 7)
    @PostMapping("/updateParam")
    EquipmentModelParamTempVO updateParam(@RequestBody EquipmentModelParamTempVO equipmentModelParamDTO) throws ServiceException;

    /**
     * 保存设备模型信息
     *
     * @param modelDTO
     * @return
     * @throws ServiceException
     */
    @ApiOperation("保存设备模型信息")
    @ApiImplicitParam(name = "equipmentModelDTO", value = "保存设备模型信息对象DTO", required = true, paramType = "query", dataType = "EquipmentModelDTO")
    @ApiOperationSupport(order = 9)
    @PostMapping("/save")
    ModelTempVO save(@RequestBody ModelTempVO modelDTO) throws ServiceException;

    PageData<EquipmentModelParamVO> queryPageParam(EquipmentModelQueryPageParamVO equipmentModelQueryPageParamVO) throws ServiceException;

    PageData<EquipmentModelVO> queryPage(EquipmentModelPageQueryParamVO equipmentModelPageQueryParamVO) throws ServiceException;

    Collection<EquipmentModelVO> exportList(EquipmentModelPageQueryParamVO equipmentModelPageQueryParamVO);

    EquipmentModelVO update(EquipmentModelVO equipmentModelVO) throws ServiceException;

    EquipmentModelParamVO savaParam(EquipmentModelParamVO equipmentModelParamVO) throws ServiceException;

    void deleteModelParam(Long id) throws ServiceException;

    EquipmentModelVO detailsModel(Long id) throws ServiceException;

    void deleteModel(Long id) throws ServiceException;

    EquipmentModelVO save(EquipmentModelVO equipmentModelVO) throws ServiceException;

    void exportExcel(List<ExportExcelModelVO> objects) throws ServiceException;

    Map<String, ModelInfoDTO> mapModelByNameList(DataParamImportEnum type, List<String> modelNameList);
}
